package week6bank;

public class BankAccount {
    private int accountNumber;
    private String passwd;
    private double balance;
    private static double interestRate=1.85 ;
    private static double miniBalance=0.0;

    public BankAccount( String passwd) {
        this.accountNumber = generateAccountNumber();
        this.passwd = passwd;
        this.balance = 0.0;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public int getAccountNumber() {
        return accountNumber;
    }

    public static int generateAccountNumber() {
        int accountNumber = 10000000+(int) (Math.random() * 1000000);
        return accountNumber;
    }

    public String getPasswd() {
        return passwd;
    }

    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }

    public static double getInterestRate() {
        return interestRate;
    }

    public static void setInterestRate(double interestRate) {
        BankAccount.interestRate = interestRate;
    }

    public static double getMiniBalance() {
        return miniBalance;
    }

    public static void setMiniBalance(double miniBalance) {
        BankAccount.miniBalance = miniBalance;
    }

    public String showInfo() {
        return "BankAccount{" +
                "accountNumber=" + accountNumber +
                ", passwd='" + passwd + '\'' +
                ", balance=" + balance +
                '}';
    }
}
